//+---------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation, 2008
//
// File: FailedFileInfo.cs
//
// Contents: Class to hold information about failures with saving a log file
//           to the drop location
//
// Created by: Adam Wardynski (AdamWa) 2/4/2008
//
//----------------------------------------------------------------------------
using System;

namespace Microsoft.Reputation.Services
{
    internal class FailedFileInfo
    {
        private string m_fileName;
        private int m_numTries;
        private DateTime m_nextRetry;

        internal FailedFileInfo(string fileName)
        {
            this.m_fileName = fileName;
            this.m_numTries = 0;
            this.m_nextRetry = DateTime.Now;
        }

        internal string FileName
        {
            get
            {
                return m_fileName;
            }
        }

        internal int NumTries
        {
            get
            {
                return m_numTries;
            }
        }

        internal DateTime NextRetryTime
        {
            get
            {
                return m_nextRetry;
            }
        }

        internal void AddFailure(int additionalSeconds)
        {
            m_numTries++;
            m_nextRetry = DateTime.Now.AddSeconds(additionalSeconds);
        }
    }
}